package com.nongfuspring.nongfu.pojo;

public class ResultBean {
    private int code;
    private Object data;

    public ResultBean(int code, Object data) {
        this.code = code;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static ResultBean ok(Object object){
        return new ResultBean(200,object);
    }

    public static ResultBean fail(Object object){
        return new ResultBean(500,object);
    }

    @Override
    public String toString() {
        return "ResultBean{" +
                "code=" + code +
                ", data=" + data +
                '}';
    }
}
